#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n, sum;
    int *a;
    while (scanf(" %d", &n) != EOF) {
        a = (int *)malloc(n * sizeof(int));
        sum = 0;
        for (int i = 0; i < n; i++)
            scanf(" %d", &a[i]);
        for (int i = 0; i < n; i++) 
            for (int j = i + 1; j < n; j++) {
                if (a[i] == a[j]) {
                    a[i] = -1;
                    a[j] = -1;
                    break;
                }
            }
        for (int i = 0; i < n; i++)
            if (a[i] != -1)
                sum += a[i];
        printf("sum = %d\n", sum);
        free(a);
    }

    return 0;
}